const path = require('path')
function resolve (dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  devServer: {
    port: 9999,
    proxy: {
      '/apiDev': {
        target: 'http://localhost:8090',
        // target: 'http://10.1.130.36:8081',
        secure: false,  
        changeOrigin: true,  
        pathRewrite: { '^/apiDev': '' }
      },
    },
  },
  transpileDependencies: [/node_modules[/\\\\](.*)[/\\\\]/,],
      css: {
        sourceMap: true,
  },
  pluginOptions: {
    'style-resources-loader': {
        preProcessor: 'scss',
        patterns: [
            resolve('src/style/mixins/mixins.scss'),
            resolve('src/style/mixins.scss'),
            resolve('src/style/variables.scss'),
        ],
    },
},
productionSourceMap:false,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('style', resolve('src/style'))
      .set('plugin', resolve('src/plugin'))
      .set('components', resolve('src/components'))
    config.entry('main').add('babel-polyfill')
  },
  configureWebpack: (config)=>{
    if(process.env.NODE_ENV === 'production'){
        config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
    }
}
}
